%% Creates the matrix of positions in core-periphery network
V = zeros(N,N); %empty matrix of positions in core-periphery network

%% periphery
for i=1:N/3
        if ~mod(i,2)==1 %i is even
            V(i,((2*N)/3-i+1)) = 1;
        elseif ~mod(i,2)==0 %i is uneven
            V(i,((2*N)/3-i+1)) = -1;
        end
end
for i=(N/3+1):(2*N/3)
        if ~mod(i,2)==1 %i is even
            V(i,((4*N)/3-i+1)) = -1;
        elseif ~mod(i,2)==0 %i is uneven
            V(i,((4*N)/3-i+1)) = 1;
        end
end

%% core
for i=(N/3+1):(2*N/3)
    for j=(i+1):(2*N/3)
        V(i,j) = (mod(i+j,2))*2-1;
    end
end

for i=2:N
    for j=1:(i-1)
        V(i,j) = -V(j,i);
    end
end